<div id="left_nav" class="span3" style="padding: 0px;">
    <div id="nav_group" class="inner_shadow">
        <?php
        echo $this->element('bank/nav_branch_sup');
        ?>
    </div>
</div>

<div class="span8" style="padding:10px; background-color: #fff; min-height: 480px;">
    <div class="page-header">
        <h3 class="remove-line-height">Transaction Reports History</h3>
    </div>

    <table class="table table-striped data-table table-bordered">
        <thead>
        <tr>
            <th colspan="2">Date</th>
            <th>Generated By</th>
            <th>Option</th>
        </tr>
        </thead>
        <tbody>
        <?php
        if(!empty($transactData)){

            $count = $this->Paginator->counter("%start%");
            foreach( $transactData as $val ) {
                $start = $val['BankReportLog']['start_trans_id'];
                $end = $val['BankReportLog']['end_trans_id'];
                $log_id = $val['BankReportLog']['id'];
                ?>
                <tr class="data-row">
                    <td><?php echo $count++.'.'; ?></td>
                    <td><?php echo  date("d M Y, g:ia", strtotime($val['BankReportLog']['created'])); ?></td>
                    <td><?php echo $val['BankUser']['fname'].' '.$val['BankUser']['mname'].' '.$val['BankUser']['lname']; ?></td>
                    <td><a href="<?php echo $this->Html->url(array('controller'=>'Bank','action' => 'get_daily_history_report/'.$start.'/'.$end.'/'.$log_id)); ?>" class="btn btn-primary btn-mini" ><i class="icon-download-alt"></i> Re Download </a></td>
                </tr>
            <?php
            }
        }
        else{
            ?>
            <tr>
                <td colspan="6" class="cell1">
                    <div>
                        No transaction histories.
                    </div>
                </td>
            </tr>
        <?php
        }
        ?>
        </tbody>
    </table>

    <div class="pagination">
        <ul>
            <?php
            echo $this->Paginator->first('First', null, null, array('tag' => 'li'));
            //echo $paginator->prev('Previous', null, null, array('tag'=>'li'));
            echo $this->Paginator->numbers(array('separator' => '', 'tag' => 'li'));
            //echo $paginator->next('Next', null, null, array('tag'=>'li'));
            echo $this->Paginator->last('Last', null, null, array('tag' => 'li'));
            ?>
        </ul>
    </div>
</div>


<input type="hidden" id="print_history" value="<?php echo $this->Html->url(array('controller' => 'Student', 'action' => 'print_history')); ?>" />

<script type="text/javascript">
    $("#print_btn").click(function(){
        var action = $("#print_history").val();
        var url = action;
        window.open(url,action,"menubar=yes, width=600, height=500,location=no,status=no,scrollbars=yes,resizable=yes");
    });
</script>